<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Schedule extends Model
{
    protected $fillable = [
        'goods_id',
        'goods_type',
        'price',
        'begin_time',
        'end_time',
        'status',  #0:正常 1:占用 2:过期 3:下架
    ];

    protected $casts = [

    ];

    public static $STATIC_MAP = [
        '正常', '佔用', '過期', '下架',
    ];

    public function getStatusFormatAttribute()
    {
        return self::$STATIC_MAP[$this->getAttribute('status')];
    }
}
